<?php
//
// +------------------------------------------------------------------------+
// | PHP Version 5                                                          |
// +------------------------------------------------------------------------+
// | Copyright (c) All rights reserved.                                     |
// +------------------------------------------------------------------------+
// | This source file is subject to version 3.00 of the PHP License,        |
// | that is available at http://www.php.net/license/3_0.txt.               |
// | If you did not receive a copy of the PHP license and are unable to     |
// | obtain it through the world-wide-web, please send a note to            |
// | license@php.net so we can mail you a copy immediately.                 |
// +------------------------------------------------------------------------+
// | Author:                                                                |
// +------------------------------------------------------------------------+
//
// $Id: Pool.php 54 2008-07-13 06:12:18Z garfield0601 $
//


/**
* @author       vv
*/
class SmartPHP_Pool extends ArrayObject
{
    
    /**
    * @var      object
    */
    private static $_instance;
    
    /**
    * @return   void
    */
    function __construct()
    {
    }

    /**
     * getInstance 
     * 
     * @static
     * @access public
     * @return void
     */
    public static function getInstance()
    {
		if(self::$_instance === null)
		{
			 $className = __CLASS__;
			 self::$_instance = new $className;
		}
		return self::$_instance;
    }
    
    /**
     * set 
     * 
     * @param string $index 
     * @param mixed $value 
     * @access public
     * @return void
     */
    public static function set($index , $value)
    {
		$instance = self::getInstance();
		$instance->offsetSet( $index , $value );
    }
    
    /**
     * get 
     * 
     * @param mixed $index 
     * @access public
     * @return mixed
     */
    public static function get( $index )
    {
		$instance = self::getInstance();
		return $instance->offsetGet( $index );
    }
    
    /**
     * isInPool 
     * 
     * @param string $index 
     * @access public
     * @return boolean
     */
    public static function isInPool( $index )
    {
		$instance = self::getInstance();
		return $instance->offsetExists( $index );
    }
    
    /**
     * remove 
     * 
     * @param string $index 
     * @access public
     * @return void
     */
    public static function remove( $index )
    {
		$instance = self::getInstance();
		$instance->offsetUnset( $index );
    }
}

?>
